﻿using System;
using Microsoft.Xna.Framework.Audio;
using Terraria.Utilities;

namespace Terraria.Audio
{
	// Token: 0x0200049C RID: 1180
	public class CustomSoundStyle : SoundStyle
	{
		// Token: 0x170002CE RID: 718
		// (get) Token: 0x0600278A RID: 10122 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public override bool IsTrackable
		{
			get
			{
				return true;
			}
		}

		// Token: 0x0600278B RID: 10123 RVA: 0x0001BA8E File Offset: 0x00019C8E
		public CustomSoundStyle(SoundEffect soundEffect, SoundType type = SoundType.Sound, float volume = 1f, float pitchVariance = 0f) : base(volume, pitchVariance, type)
		{
			this._soundEffects = new SoundEffect[]
			{
				soundEffect
			};
		}

		// Token: 0x0600278C RID: 10124 RVA: 0x0001BAAA File Offset: 0x00019CAA
		public CustomSoundStyle(SoundEffect[] soundEffects, SoundType type = SoundType.Sound, float volume = 1f, float pitchVariance = 0f) : base(volume, pitchVariance, type)
		{
			this._soundEffects = soundEffects;
		}

		// Token: 0x0600278D RID: 10125 RVA: 0x0001BABD File Offset: 0x00019CBD
		public override SoundEffect GetRandomSound()
		{
			return this._soundEffects[CustomSoundStyle._random.Next(this._soundEffects.Length)];
		}

		// Token: 0x040043CC RID: 17356
		private static UnifiedRandom _random = new UnifiedRandom();

		// Token: 0x040043CD RID: 17357
		private SoundEffect[] _soundEffects;
	}
}
